import Vue from 'vue'
import VueRouter from 'vue-router'
Vue.use(VueRouter)

const routes = [
  // 重定向
  {
    path: '*',
    redirect: '/login'
  },
  {
    path: '/login',
    name: 'Login',
    component: () => import('../views/login.vue'),
    // 路由元信息
    meta: { title: '登录', show: 'true' }
  },
  // 首页
  {
    path: '/home',
    name: 'Home',
    redirect: '/index',
    component: () => import('../views/Home/index.vue'),
    // 路由元信息
    // meta: {title: '首页',show: 'true'},
    children: [
      {
        path: '/index',  //首页模块
        name: 'index',
        component: () => import('../views/Home/index/index.vue'),
        // 路由元信息
        // meta: {title: '销售',show: 'true' }
      },
      {
        path: '/change',  //销售模块
        name: 'change',
        component: () => import('../views/Home/change/children/changetable.vue'),
      },
      {
        path: '/changetable',  //销售列表
        name: 'changetable',
        component: () => import('../views/Home/change/children/changetable.vue'),
      },
      {
        path: '/changeface',  //销售面板
        name: 'changeface',
        component: () => import('../views/Home/change/children/changeface.vue'),
      },
      {
        path: '/changedata',  //底层数据
        name: 'changedata',
        component: () => import('../views/Home/change/children/changedata.vue'),
      },
      {
        path: '/details',  //销售机会详情页面
        name: 'details',
        component: () => import('../views/Home/change/details.vue'),
      },
      {
        path: '/apply',    //报销管理
        name: 'apply',
        component: () => import('../views/Home/apply/children/index.vue'),
        // 路由元信息
        // meta: {title: '报销',show: 'true'}

      },
      {
        path: '/applytable',    //财务报表
        name: 'applytable',
        component: () => import('../views/Home/apply/children/applytable.vue'),
        // 路由元信息
        // meta: {title: '报销',show: 'true'}

      },
      {
        path: '/insert',    //报销添加
        name: 'insert',
        component: () => import('../views/Home/apply/insert.vue'),
        // 路由元信息
        // meta: {title: '报销',show: 'true'}
      },
      {
        path: '/apply/update',    //报销修改
        name: 'applyUpdate',
        component: () => import('../views/Home/apply/update.vue'),
        // 路由元信息
        // meta: {title: '报销',show: 'true'}
      },


      {
        path: '/agreement',    //合同模块
        name: 'agreement',
        // component: () => import('../views/Home/agreement/index.vue'),
        // 路由元信息
        // meta: {title: '报销',show: 'true'}
      },
      {
        path: '/agreementtable',    //合同列表
        name: 'agreementtable',
        component: () => import('../views/Home/agreement/children/agreementtable.vue'),
        // 路由元信息
        // meta: {title: '报销',show: 'true'}
      },
      {
        path: '/agreementface',    //合同面板
        name: 'agreementface',
        component: () => import('../views/Home/agreement/children/agreementface.vue'),
        // 路由元信息
        // meta: {title: '报销',show: 'true'}
      },
      {
        path: '/insertAgreement',    //创建合同
        name: 'insertAgreement',
        component: () => import('../views/Home/agreement/insertAgreement.vue'),
        // 路由元信息
        // meta: {title: '报销',show: 'true'}
      },
      {
        path: '/agreementDetails',    //合同详情
        name: 'agreementDetails',
        component: () => import('../views/Home/agreement/agreementDetails.vue'),
        // 路由元信息
        // meta: {title: '报销',show: 'true'}
      },
      {
        path: '/custem',  //客户
        name: 'custem',
        component: () => import('../views/Home/custem/children/custem.vue'),
      },
      {
        path: '/linkman',  //联系人
        name: 'linkman',
        component: () => import('../views/Home/custem/children/linkman.vue'),
      },
      {
        path: '/custem/detail',    //客户详情模块
        name: 'custemDetail',
        component: () => import('../views/Home/custem/custemDetail.vue'),
        // 路由元信息
        // meta: {title: '客户',show: 'true'}
      },
      {
        path: '/custem/linkman',    //联系人详情模块
        name: 'linkmanDetail',
        component: () => import('../views/Home/custem/linkmanDetail.vue'),
        // 路由元信息
        // meta: {title: '客户',show: 'true'}
      },
      {
        path: '/custem',    //客户模块
        name: 'custem',
        component: () => import('../views/Home/custem/index.vue'),
        // 路由元信息
        // meta: {title: '客户',show: 'true'}
      },
      {
        path: '/InsertCustem',    //客户添加
        name: 'InsertCustem',
        component: () => import('../views/Home/custem/InsertCustem.vue'),
        // 路由元信息
        // meta: {title: '报销',show: 'true'}
      },
      {
        path: '/staff',     //员工模块
        name: 'staff',
        component: () => import('../views/Home/staff/index.vue'),
        // 路由元信息
        // meta: {title: '员工',show: 'true'}
      },
      {
        path: '/InsertStaff',    //员工添加
        name: 'InsertStaff',
        component: () => import('../views/Home/staff/InsertStaff.vue'),
        // 路由元信息
        // meta: {title: '报销',show: 'true'}
      },
      {
        path: '/staff/detail',    //员工详情模块
        name: 'staffDetail',
        component: () => import('../views/Home/staff/staffDetail.vue'),
        // 路由元信息
        // meta: {title: '客户',show: 'true'}
      },

      {
        path: '/system',     //系统管理模块
        name: 'system',
        component: () => import('../views/Home/system/children/system.vue'),
        // 路由元信息
        // meta: {title: '员工',show: 'true'}
      },
      {
        path: '/section',     //计划经费配比
        name: 'section',
        component: () => import('../views/Home/system/children/section.vue'),
        // 路由元信息
        // meta: {title: '员工',show: 'true'}
      },
      {
        path: '/oasystem',     //oa系统管理模块
        name: 'oasystem',
        component: () => import('../views/Home/oa/oasystem.vue'),
        // 路由元信息
        // meta: {title: '员工',show: 'true'}
      },
      {
        path: '/fixed',     //固定资产管理模块
        name: 'fixed',
        component: () => import('../views/Home/fixed/fixed.vue'),
        // 路由元信息
        // meta: {title: '员工',show: 'true'}
      },
    ]
  },



]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
